package com.cloudkinto.service.stock;

import com.cloudkinto.entity.*;
import com.baomidou.mybatisplus.extension.service.IService;

import com.cloudkinto.common.web.PageResult;
import com.cloudkinto.common.web.SingleResult;
import com.cloudkinto.extentity.StockPickUpDto;
import com.cloudkinto.extentity.stock.PickupStockRackDto;
import com.cloudkinto.service.orderoutput.vo.BatchPickUpRes;
import com.cloudkinto.service.orderoutput.vo.PositionAndNumberDTO;
import com.cloudkinto.service.product.vo.rack.SendRes;
import com.cloudkinto.service.stock.vo.*;
import com.cloudkinto.service.storage.vo.PickupPreviewRes;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * <p>
 * service接口
 * </p>
 *
 * @author zhujiale
 * @since 2022-12-23
 */
public interface StockPickUpService extends IService<StockPickUpDo> {

    SingleResult addInit();

    Object add(Object req, Long userId);

    SingleResult updateInit(Long id);

    String update(UpdatePickUpReq req, Long userId);

    void finishPickUp(StockPickUpDo pickUpDo, Set<String> orderNoSet, Long userId, Long orderOutputId);

    List<PositionAndNumberDTO> getPosList(StockPickUpDo pickUpDo, Set<String> orderNoSet, Long orderOutputId, boolean view);

    void finishPickUpAfter(Long pickupId, Long userId);

    void finishPickUpAfter(StockPickUpDo pickUpDo, Long userId);

    int delete(Long id, Long userId);

    Object detail(Long id);

    SingleResult pageInit();

    List<Object> getList(Map<String, String> map);

    PageResult getListPage(Map<String, String> map);

    void exportExcel(Long id, String sortType, HttpServletResponse response) throws IOException;

    List<PositionAndNumberDTO> getPostListByOrderId(StockPickUpDo pickUpDo, Long orderId, String storageName);

    int getPositionAndNumberDTO(List<PositionAndNumberDTO> positionAndNumberList, PickupStockRackDto st, ProductInfoDo productInfoDo, StorageDo storageDo, int goodQuantity, Long orderId);

    List<PositionAndNumberDTO> getShowList(List<PositionAndNumberDTO> positionAndNumberList);

    void deletePickUp(Long pickUpId, Long orderId);

    List<RackStockRes> getRackStock(Long id, Long productId, Long storageId);

    StockPickUpDto updatePickUpInit(Long id, String sortType);

    void updatePickUp(StockPickUpdateReq req, Long userId);

    StockPickupPreviewRes pickUpPreview(Long id);

    Map<String, List<OrderOutputDo>> getOrderMapList(List<OrderOutputDo> list, Map<Long, List<OrderOutputProductDo>> productMapList);

    void generatePickup();

    SendRes getPositionList(List<OrderOutputDo> orderOutputList, Map<Long, List<OrderOutputProductDo>> productMapList, List<PositionAndNumberDTO> positionAndNumberList, List<PositionAndNumberDTO> defaultPositionList, StockPickUpRuleDo ruleDo);

    void claimPickup(Long id, Long userId);

    List<Map<String, Object>> getClaimUserId();

}
